package com.longrise.android.byjk.plugins.dealsituation.course.video2.params;

import android.text.TextUtils;

import com.longrise.android.byjk.plugins.dealsituation.course.exercises.ExercisesActivity;
import com.longrise.android.byjk.plugins.dealsituation.course.video2.education.insurance.InsuranceActivity;
import com.longrise.android.byjk.plugins.dealsituation.course.video2.education.picedu.PictureActivity;
import com.longrise.android.byjk.plugins.dealsituation.course.video2.education.webpicedu.WebEduActivity;
import com.longrise.android.byjk.plugins.dealsituation.course.video2.education.webvideoedu.WebVideoEduActivity;


/**
 * Created by godliness on 2017/8/17.
 */

public class ToDispatchStudy {

    /**
     * 该常量值不可修改
     */
    public static final String VIDEO = "video";
    public static final String VIDEO_WORD = "video_word";
    public static final String VIDEO_WORDNULL = "video_wordnull";
    public static final String PIC_WORD = "pic_word";
    public static final String PIC_ZICE = "pic_zice";
    public static final String PIC_MONI = "pic_moni";
    public static final String PIC = "pic";
    public static final String TEST = "test";

    /**
     * 根据课件类型对应学习界面
     */
    public static Class<?> dispatchStudyStart(String cwidStyle) {
        if (strIsEmpty(cwidStyle)) {
            return null;
        }
        Class<?> clz;
        switch (cwidStyle) {
            case VIDEO:
                clz = InsuranceActivity.class;
                break;

            case VIDEO_WORD:
            case VIDEO_WORDNULL:
                clz = WebVideoEduActivity.class;
                break;

            case PIC_WORD:
            case PIC_ZICE:
            case PIC_MONI:
                clz = WebEduActivity.class;
                break;

            case PIC:
                clz = PictureActivity.class;
                break;

            case TEST:
//                clz = SimulationTestActivity.class;
                clz = ExercisesActivity.class;
                break;

            default:
                clz = null;
                break;
        }
        return clz;
    }

    private static boolean strIsEmpty(String params) {
        return TextUtils.isEmpty(params);
    }
}

